<?php require('includes/functions.php'); ?>
<!DOCTYPE html>
<html>
	<head>
		<title>Logs</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<?php $logs = getAllLogs(); ?>
		<?php if ($logs): ?>
		<table cellspacing="0" cellpadding="5" border="1">
			<tr>
				<th>Employee ID</th>
				<th>Date</th>
				<th>Reason</th>
			</tr>
			<?php foreach ($logs as $log): ?>
			<tr class="<?php echo ($log->reason_id != 1) ? 'inactive':'active' ?>">
				<td>
					<a href="view_employee.php?id=<?php echo $log->employee_id ?>">
						<?php echo $log->employee_id ?>
					</a>
				</td>

				<td><?php echo $log->date ?></td>
				<td><?php echo $log->reason ?></td>
			</tr>
			<?php endforeach ?>
		</table>
		<?php else: ?>
			No logs found.
		<?php endif ?>
		<center>
			<input type="button" value="Back" onclick="history.go(-1)" />
		</center>
	</body>
</html>